package com.jeesite.modules.dp.entity.order;

import java.util.Date;
import java.util.List;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.modules.dp.entity.orderdetail.DpOrderdetail;

/**
 * 订单管理Entity
 * @author hancing
 * @version 2024-12-06
 */
@Table(name="dp_order", alias="a", label="订单信息", columns={
		@Column(name="id", attrName="id", label="id", isPK=true),
		@Column(name="title", attrName="title", label="订单名称", isQuery=false),
		@Column(name="userno", attrName="userno", label="用户账号"),
		@Column(name="jinger", attrName="jinger", label="金额"),
		@Column(name="outpayno", attrName="outpayno", label="订单号"),
		@Column(name="ordertype", attrName="ordertype", label="订单类型"),
		@Column(name="paytype", attrName="paytype", label="支付方式", isQuery=false),
		@Column(name="dikoujiner", attrName="dikoujiner", label="余额扣款", isQuery=false, isUpdateForce=true),
		@Column(name="wxjiner", attrName="wxjiner", label="微信支付金额", isQuery=false),
		@Column(name="iswxpay", attrName="iswxpay", label="是否支付"),
		@Column(name="paytime", attrName="paytime", label="支付时间", isQuery=false, isUpdateForce=true),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class DpOrder extends DataEntity<DpOrder> {
	
	private static final long serialVersionUID = 1L;
	private String title;		// 订单名称
	private String userno;		// 用户账号
	private Double jinger;		// 金额
	private String outpayno;		// 订单号
	private String ordertype;		// 订单类型
	private String paytype;		// 支付方式
	private Double dikoujiner;		// 余额扣款
	private Double wxjiner;		// 微信支付金额
	private String iswxpay;		// 是否支付
	private Date paytime;		// 支付时间
   
	private String codeurl;
	private Date codeurltime;
	
	private String createok;
	private String createerrmsg;
	
	//传递数据使用
	private List<DpOrderdetail> orderdetails;
	private Double qyjmoney;
	private int frontorderstatus=0;
	/**
	 * 微信支付码失效时间，格式：yyyyMMddHHmmss
	 */
    private String wxPayExpireTime;
	
	
	public DpOrder() {
		this(null);
	}
	
	public DpOrder(String id){
		super(id);
	}
	
	@NotBlank(message="订单名称不能为空")
	@Size(min=0, max=255, message="订单名称长度不能超过 255 个字符")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
	@NotBlank(message="用户账号不能为空")
	@Size(min=0, max=64, message="用户账号长度不能超过 64 个字符")
	public String getUserno() {
		return userno;
	}

	public void setUserno(String userno) {
		this.userno = userno;
	}
	
	@NotNull(message="金额不能为空")
	public Double getJinger() {
		return jinger;
	}

	public void setJinger(Double jinger) {
		this.jinger = jinger;
	}
	
	@Size(min=0, max=64, message="订单号长度不能超过 64 个字符")
	public String getOutpayno() {
		return outpayno;
	}

	public void setOutpayno(String outpayno) {
		this.outpayno = outpayno;
	}
	
	@NotBlank(message="订单类型不能为空")
	@Size(min=0, max=1, message="订单类型长度不能超过 1 个字符")
	public String getOrdertype() {
		return ordertype;
	}

	public void setOrdertype(String ordertype) {
		this.ordertype = ordertype;
	}
	
	@Size(min=0, max=1, message="支付方式长度不能超过 1 个字符")
	public String getPaytype() {
		return paytype;
	}

	public void setPaytype(String paytype) {
		this.paytype = paytype;
	}
	
	public Double getDikoujiner() {
		return dikoujiner;
	}

	public void setDikoujiner(Double dikoujiner) {
		this.dikoujiner = dikoujiner;
	}
	
	
	public Double getWxjiner() {
		return wxjiner;
	}

	public void setWxjiner(Double wxjiner) {
		this.wxjiner = wxjiner;
	}
	
	@NotBlank(message="是否支付不能为空")
	@Size(min=0, max=1, message="是否支付长度不能超过 1 个字符")
	public String getIswxpay() {
		return iswxpay;
	}

	public void setIswxpay(String iswxpay) {
		this.iswxpay = iswxpay;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getPaytime() {
		return paytime;
	}

	public void setPaytime(Date paytime) {
		this.paytime = paytime;
	}

	public String getCodeurl() {
		return codeurl;
	}

	public void setCodeurl(String codeurl) {
		this.codeurl = codeurl;
	}

	public Date getCodeurltime() {
		return codeurltime;
	}

	public void setCodeurltime(Date codeurltime) {
		this.codeurltime = codeurltime;
	}

	public String getCreateok() {
		return createok;
	}

	public void setCreateok(String createok) {
		this.createok = createok;
	}

	public List<DpOrderdetail> getOrderdetails() {
		return orderdetails;
	}

	public void setOrderdetails(List<DpOrderdetail> orderdetails) {
		this.orderdetails = orderdetails;
	}

	public Double getQyjmoney() {
		return qyjmoney;
	}

	public void setQyjmoney(Double qyjmoney) {
		this.qyjmoney = qyjmoney;
	}

	public int getFrontorderstatus() {
		return frontorderstatus;
	}

	public void setFrontorderstatus(int frontorderstatus) {
		this.frontorderstatus = frontorderstatus;
	}

	public String getCreateerrmsg() {
		return createerrmsg;
	}

	public void setCreateerrmsg(String createerrmsg) {
		this.createerrmsg = createerrmsg;
	}

	public String getWxPayExpireTime() {
		return wxPayExpireTime;
	}

	public void setWxPayExpireTime(String wxPayExpireTime) {
		this.wxPayExpireTime = wxPayExpireTime;
	}
}